from bs4 import BeautifulSoup
import requests
import re


url = 'https://www.baidu.com/'
headers = {
    "user-agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36"
}
params={

}
req = requests.get(url,headers=headers)

soup = BeautifulSoup(req.text, 'html.parser')
req = soup.find(attrs={"id":"s_lg_img"})
imgurl = re.sub(r"/", "", req.attrs["src"])
print(imgurl)
